﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="BulkUserUpload.aspx.vb" Inherits="Training.BulkUserUpload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Bulk User Creation</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="ctr">
        <h2>Bulk User Creation</h2>
        
        <div style="width:400px;text-align:left;margin:0 auto;" class="text">
            <p>Upload a CSV to create* users for the selected Group. Please 
            use our 
            <a href="../userImportTemplate.csv">CSV template</a> to format your data for upload. Users will 
            have their login names (based on first and last names) and passwords 
            generated and sent to their email address.</p>
            
            <span class="small">(* depending on the number of users, processing can take 
            several minutes. Please do NOT click the Create Users button again. A message 
            will display when processing is complete.)</span>
            
            <p>Select Group: 
                <asp:DropDownList ID="ddlGroups" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="dsGetAllGroups" DataTextField="GroupName" 
                    DataValueField="GroupID" CssClass="formfield">
                    <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
                </asp:DropDownList> 
                &nbsp; <asp:RangeValidator ID="rvGroup" runat="server" ErrorMessage="required" 
                    ControlToValidate="ddlGroups" CssClass="small" Display="Dynamic" 
                    MaximumValue="99999" MinimumValue="1" Type="Integer"></asp:RangeValidator>
            </p>
            
            <p>Select State: 
                <asp:DropDownList ID="ddlState" runat="server" AppendDataBoundItems="True" 
                    DataSourceID="dsStates" DataTextField="StateName" 
                    DataValueField="StateId" CssClass="formfield">
                    <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
                </asp:DropDownList> 
                <asp:RangeValidator ID="rvState" runat="server" ErrorMessage="required" 
                    ControlToValidate="ddlState" CssClass="small" Display="Dynamic" 
                    MaximumValue="60" MinimumValue="1" Type="Integer"></asp:RangeValidator></p>
            
            <p><asp:FileUpload ID="fuMain" CssClass="formfield" runat="server" /> 
                &nbsp; <asp:RequiredFieldValidator ID="rfUpload" runat="server" 
                    ErrorMessage="required" ControlToValidate="fuMain" CssClass="small" 
                    Display="Dynamic"></asp:RequiredFieldValidator></p>
            
            <asp:Button ID="btnInsert" CssClass="button" runat="server" Text="Create Users" />
            
            <br />
            
            <asp:Label ID="lblResults" runat="server" Text=""></asp:Label><br />
            <asp:Label ID="lblProcessing" runat="server" Text=""></asp:Label>
        </div>
        
        <p><a href="Default.aspx">Admin Main</a></p>
    
    </div>
    
    <asp:SqlDataSource ID="dsGetAllGroups" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [GroupID], [GroupName] FROM [Groups] ORDER BY [GroupName]"></asp:SqlDataSource>
    
    <asp:SqlDataSource ID="dsStates" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Conn %>" 
        SelectCommand="SELECT [StateId], [StateName] FROM [States] ORDER BY [StateName]"></asp:SqlDataSource>
    </form>
</body>
</html>
